package com.tsingxiao.codegenerate.service.impl;

import com.tsingxiao.codegenerate.mapper.DemoMapper;
import com.tsingxiao.codegenerate.pojo.Demo;
import com.tsingxiao.codegenerate.service.DemoService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author qingchang.tang
 * @date 2020/1/7 15:03
 */

@Service
@Slf4j
@AllArgsConstructor
public class DemoServiceImpl implements DemoService {

    private final DemoMapper demoMapper;

    @Override
    public int save(Demo o) {
        return demoMapper.saveOne(o);
    }

    @Override
    public List<Demo> list() {
        return demoMapper.selectAll();
    }
}
